ycy@ycy-virtual-machine:~$ mkdir shiyanlou
ycy@ycy-virtual-machine:~$ cd shiyanlou/
ycy@ycy-virtual-machine:~/shiyanlou$ mkdir week1
ycy@ycy-virtual-machine:~/shiyanlou$ cd week1/
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi first.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 742 first.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./first.sh 
hello world!
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo #aabbccdd

ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo \#aabbccdd
#aabbccdd
ycy@ycy-virtual-machine:~/shiyanlou/week1$ string=hello
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $string
hello
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo "$string"
hello
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo "*abc"
*abc
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo "$string"
hello
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo "\string"
\string
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo "\#string"
\#string
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo "\$string"
$string
ycy@ycy-virtual-machine:~/shiyanlou/week1$ string='$PATH'
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $string
$PATH
ycy@ycy-virtual-machine:~/shiyanlou/week1$ string="$PATH"
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $string
/home/ycy/GmSSL-3.1.1-Linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
ycy@ycy-virtual-machine:~/shiyanlou/week1$ string='pwd'
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $string
pwd
ycy@ycy-virtual-machine:~/shiyanlou/week1$ B='cat A|grep 123'
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${B}
cat A|grep 123
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo "$B"
cat A|grep 123
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo '$B'
$B
ycy@ycy-virtual-machine:~/shiyanlou/week1$ s1=hello
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${s1}world
helloworld
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $s1world

ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${HOME}
/home/ycy
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${PATH}
/home/ycy/GmSSL-3.1.1-Linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${TERM}
xterm-256color
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${UID}
1000
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${PWD}
/home/ycy/shiyanlou/week1
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${PS1}
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${PS2}
>
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${IFS}

ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $_
echo
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $*

ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $?
0
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $#
0
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $$
3737
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $0
bash
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $@

ycy@ycy-virtual-machine:~/shiyanlou/week1$ message="hello world!"
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $message
hello world!
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo $_
world!
ycy@ycy-virtual-machine:~/shiyanlou/week1$ name=${username:-'whoami'}
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${name}
whoami
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${username}

ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${username}

ycy@ycy-virtual-machine:~/shiyanlou/week1$ username=aaa
ycy@ycy-virtual-machine:~/shiyanlou/week1$ name=${username:-'whoami'}
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${name}
aaa
ycy@ycy-virtual-machine:~/shiyanlou/week1$ unset username
ycy@ycy-virtual-machine:~/shiyanlou/week1$ name=${username:="jerry"}
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${name}
jerry
ycy@ycy-virtual-machine:~/shiyanlou/week1$ echo ${username}
jerry
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi loop.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 777 loop.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./loop.sh 

0
1
2
3
4
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi loop.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./loop.sh 

1
./loop.sh: 第 4 行： [: expr $x \* 2: 需要整数表达式
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi loop.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./loop.sh 

name isnull
name is notnull
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi 15.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 777 15.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./15.sh 


./15.sh: 行 8: 未预期的记号 ")" 附近有语法错误
./15.sh: 行 8: `*) echo "number is bigger than 9";;'
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi until.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 777 until.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./until.sh 

–n please input your name: 
ycy
./until.sh: 行 7: [ycy: 未找到命令
the name you input is wrong,please input again: ycy
./until.sh: 行 7: [ycy: 未找到命令
the name you input is wrong,please input again: 
./until.sh: 第 7 行： [: =: 需要一元运算符
the name you input is wrong,please input again: ^C
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi while.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 777 while.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./while.sh 

–n please input your name: 
ycy
./while.sh: 行 8: 未预期的记号 "done" 附近有语法错误
./while.sh: 行 8: `done'
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi for .sh
还有 2 个文件等待编辑
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi for.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 777 for.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./for.sh 

number is 1
number is 2
number is 3
number is 4
number is 5
number is 6
number is 7
number is 8#number变量分别取得参数列表中的1、2、3、4、5、6、7、8
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./array.sh 

array[0]=jerry
array[1]=tom
array[2]=alice
array[3]=keven
array[4]=julie
all array is jerry tom alice keven julie
array2[10]=hello
array2[15]=
array2[20]=world
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi menu.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./menu.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi error.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 777 error.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./error.sh 

./error.sh: 行 6: [37: 未找到命令
ycy@ycy-virtual-machine:~/shiyanlou/week1$ vi trap.sh
ycy@ycy-virtual-machine:~/shiyanlou/week1$ chmod 777 trap.sh 
ycy@ycy-virtual-machine:~/shiyanlou/week1$ ./trap.sh 

a= b=
